1. Field of the Invention
The invention relates to optical and magnetic disks, and more particularly to techniques for avoiding or aocommodating defects on such disks for the storage of data.
2. Background of the Invention
Magnetic disks are frequently used for the storage of data in computer systems. Recently, various types of optical disks have also begun reaching the market. These include read-only disks, write-once disks, as well as full function read/write disks.
A problem common to all disks is that they cannot be manufactured entirely free of defects. That is, no matter how carefully the disk is manufactured, there will always be some portion of the disk on which the data which is read will not be the same as the data which was previously written. Such defects may also arise during use, even if not present immediately after manufacture. This problem is more acute in the relatively young field of optical disks, on which defects are many times more common than they are in the technologically mature field of magnetic disks.
Disks used in computer applications are typically divided into concentric tracks, and each track divided into one or more sectors. If the disk is two-sided, or if multiple platters are rotated simultaneously, then the various concentric tracks of the various surfaces are usually lined up to form concentric cylinders, the tracks of which may be accessed concurrently by different heads. In the case of optical disks, where the spiral recording format has been carried over from the audio applications of such disks, concentric tracks are simulated by placing a marker at the end of each revolution of the spiral track and causing the tracking mechanism to skip inward by one track each time such an index mark is encountered. In this way the gradual outward motion of the tracking mechanism caused by the spiral of the disk is countered once each revolution to maintain the head on the same segment of the spiral through multiple revolutions of the disk.
A disk may either be hard-sectored or soft-sectored. In hard-sectored disks, a hole or other physical index marking is placed on the disk such that it triggers a pulse (called an index pulse) once each revolution. Physical markings are also placed at fixed intervals around the disk, for example at 18.degree. intervals, to indicate the start of each sector in a track. A disk formatted with these physical markings is referred to as being hard-sectored because the sectors cannot be moved to different positions on a track once the disk leaves the manufacturer. However, it should be noted that some types of disks referred to as being hard-sectored are in fact modifiable in the field. The sector marks on these disks constitute a unique pattern laid down on the medium which is readable and modifiable with appropriate circuitry.
Soft-sectored disks also have an index mark to indicate the beginning of each track on the disk. Markings to indicate the beginning of sectors, however, are not fixed in the medium, and are laid down under software control. Additionally, sectors on a soft-sectored disk may be placed at different angular positions on different tracks if desired.
Typically, a sector includes a header area followed by a data area. The header area is preceded by a gap, which is used to permit the disk controller circuitry enough time to prepare to read the header after the beginning of the sector is recognized. The header begins with a VFO region, which the head read circuitry recognizes and uses to set its internal bit-clock frequency. The VFO region is followed by a sync region. The say region contains a code which the disk controller uses to properly divide the incoming stream of bits into bytes. The header then includes an identification section, which usually contains two bytes for the track number, one byte for the head number and one byte for the sector number. The header may include other information as well. Following the header, there is a second gap to allow time for the disk controller to determine whether the sector identification information indicates that this is the desired sector, and time to raise the write signal if information is to be written into the data area of this sector. If the header area includes an error detection code (e.g., a CRC), then this gap also provides the time necessary to determine whether the header contained an error.
The data area in a sector begins with a VFO region and a sync region, which are typically followed immediately by all the data bytes for the sector. An error detection code (EDC) or an error detection and correction code (EDAC) may also be included. A third gap follows the data area, prior to the beginning of the next sector, in order to accommodate variations in the speed of the motor rotating the disk.
A number of different mechanisms have been used in the past to accommodate defects. One technique which is often used when an error is encountered while the disk is in service involves simply rereading the data. A read operation may be attempted three times before a failure is indicated. This techniques sometimes permits recovery of data which would otherwise be considered lost if the defect causing the error is only intermittent in nature (i.e., "soft" defects). The technique provides no improvement if the defect is permanent (i.e., "hard"), however, and is not guaranteed to work even if the defect is intermittent.
In another common mechanism, an error detection and correction code (EDAC) is used in each sector in order to add a measure of redundancy to the information stored in that sector. When the information is written to the disk, a checking code is calculated and written to the disk along with the information. When the information is read back from the disk, a new checking code is calculated and compared with the checking code which Was written to disk with the data. If the two checking codes are identical, then the data is assumed to be accurate. If they are different, then an error exists and an attempt may be made to correct the erroneous data.
This mechanism is effective as far as it goes, and useful on disks which use other defect accommodation techniques as well. The mechanism has a capacity of only a certain number of errors per checking block, however, and it is desirable to reserve that capacity for defects which arise during service after the disk has been formatted or otherwise initialized. It is therefore desirable to use other techniques if a defect is discovered during the formatting stage.
One technique used in the formatting stage for accommodating defects in magnetic or writable optical disks is referred to as sector relocation. In this technique, one or two spare tracks on a disk may be reserved for storing sectors of data which would otherwise encompass a defect. In a typical formatting operation, a sector is repeatedly written with data, read and compared to the original. If less than a certain number of errors appear, the sector is considered good and error management is left to EDAC techniques. Otherwise, the sector is considered bad and marked as such. A pointer is also written into the header portion of the bad sector pointing to the spare track, such that the head will move to the same sector on the spare track whenever a read from, or write to the bad sector is encountered.
An important problem with the sector relocation technique is that the error which is causing the sector to be considered bad may be due to only a few bad bytes. This is a fairly common occurrence on magnetic disks and even more common on optical disks. Thus an entire sector of data may be wasted for only a few bad bytes. Another problem with this technique arises because files are frequently stored on disk in sequential sectors. If a sector is relocated because the normally sequential sector contains a defect, a time penalty is paid whenever the entire file is being read out.
Another technique used in the formatting stage is known as sector sparing. This technique is similar to the sector relocation technique, except that the spare sectors are located at the end of each track instead of on a separate spare track. The sector sparing technique has the same deficiencies as the sector relocation technique.
In yet another technique for accommodating defects on a disk, available for soft-sectored disks only, data is first written onto a track and then read back to determine the location of any defects. Sector marks, headers and data regions are then written onto the track in such a way that all the discovered defects are located in gap areas. This technique provides an improvement over the sector relocation and sector sparing techniques, but it is still not optimum. For example, if a defect is discovered toward the end of what would otherwise be a data area, the gap area which precedes the data area would have to be extended nearly to the size of a data area (e.g., 1K bytes) in order to use this technique.
Yet another technique for accommodating defects on a disk is set forth in an engineering specification by Magnetic Peripherals, Inc. Under this specification, a sector may be in either a 4K format or a 16K format. In the 4K format, the header contains information permitting the controller to skip over a fixed size 96-byte area of the media centered over the defect. The defect can be as large as 64 bytes before it is considered unmanageable with this technique and relegated to other defeot management techniques. In the 16K format, two skips in a single data area are accommodated. These two skips may be concatenated to form a single 160-byte skip. The header for each sector contains a flag word which indicates whether the data area contains 0, 1 or, in the case of the 16K format, 2 skips. The header also includes one or two 2-byte defect pointers. If the data area contains a defect, then the first defect pointer contains the size, in bytes, from the beginning of the data segment to the beginning of the first skip. If the sector is in 4K format, then the data resumes immediately after the 96-byte skip and continues until the end of the data area. If the sector is in 16K format and the flag word indicates that the data area contains a second defeot, then the second defect pointer contains the number of bytes between the first skip and the second skip. Reading of data resumes immediately after the second skip and continues until the end of the data area.
The technique described in the engineering specification can be more flexible than any of the previously described techniques, but it still has deficiencies. First, since the defect skip is always 96 bytes. 96 bytes will always be lost even if the defect is much smaller. In order to understand the second deficiency, it is useful to note that disk controllers typically include match logic for determining whether the sector then being read from the disk is the sector desired by the controller. As the sector identification information is read from the header, it is compared by the match logic, byte by byte, with stored information identifying the desired sector. If this same match logic is also required to test the flag words (which are also in the header) as they arrive, in order to determine which, if any, of the defect pointers contain valid information, then the match logic can become extremely complex. Such complexity is a serious problem at the rates at which data arrives from the disk. Data rates are extremely quick, requiring that the match logic be as simple as possible.